package com.smart.controller;

import com.smart.common.WebResponse;
import com.smart.common.annotation.WebAccess;
import com.smart.model.vo.IndexStatisticalAnalysisVO;
import com.smart.service.HomePageService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: zyh
 * @date: 2023-07-02
 */
@RestController
@RequestMapping("/homePage")
@Api(tags = {"A通用模块#首页大屏模块"})
public class HomePageController {

    @Autowired
    private HomePageService homePageService;

    @WebAccess(login = true)
    @GetMapping("getSuperviseHomepageOne")
    @ApiOperation("云监管首页工程状态查询查询")
    public WebResponse getSuperviseHomepageOne(){
        return new WebResponse<>(homePageService.getSuperviseHomepageOne());
    }

    @WebAccess(login = true)
    @GetMapping("getSuperviseHomepageTwo")
    @ApiOperation("云监管首页工程类型查询")
    public WebResponse getSuperviseHomepageTwo(){
        return new WebResponse<>(homePageService.getSuperviseHomepageTwo());
    }

    @WebAccess(login = true)
    @GetMapping("getSuperviseHomepageThree")
    @ApiOperation("云监管首页项目人员分布查询")
    public WebResponse getSuperviseHomepageThree(){
        return new WebResponse<>(homePageService.getSuperviseHomepageThree());
    }

    @WebAccess(login = true)
    @GetMapping("getSuperviseHomepageFour")
    @ApiOperation("云监管首页全区项目人员流动性统计查询")
    public WebResponse getSuperviseHomepageFour(){
        return new WebResponse<>(homePageService.getSuperviseHomepageFour());
    }

    @WebAccess(login = true)
    @GetMapping("getSuperviseHomepageFive")
    @ApiOperation("云监管首页全区动火作业统计查询")
    public WebResponse getSuperviseHomepageFive(){
        return new WebResponse<>(homePageService.getSuperviseHomepageFive());
    }

    @WebAccess(login = true)
    @GetMapping("getServiceHomepage")
    @ApiOperation("云服务首页查询")
    public WebResponse getServiceHomepage(){
        return new WebResponse<>(homePageService.getServiceHomepage());
    }

    @WebAccess(login = true)
    @GetMapping("getManageHomepage")
    @ApiOperation("云管理首页查询")
    public WebResponse getManageHomepage(){
        return new WebResponse<>(homePageService.getManageHomepage());
    }

    @WebAccess(login = true)
    @GetMapping("getOperateHomepage")
    @ApiOperation("运营管理首页查询")
    public WebResponse getOperateHomepage(){
        return new WebResponse<>(homePageService.getOperateHomepage());
    }

    @WebAccess(login = true)
    @GetMapping("getlargeScreenLeft")
    @ApiOperation("大屏左侧三个饼状图")
    public WebResponse getlargeScreenLeft(){
        return new WebResponse<>(homePageService.getlargeScreenLeft());
    }

    @WebAccess(login = true)
    @GetMapping("getlargeScreenList")
    @ApiOperation("大屏列表")
    public WebResponse getlargeScreenList(){
        return new WebResponse<>(homePageService.getlargeScreenList());
    }

    @WebAccess(login = true)
    @GetMapping("getlargeScreenRight/{projectId}")
    @ApiOperation("大屏右侧数据")
    public WebResponse getlargeScreenRight(@PathVariable("projectId")Long projectId){
        return new WebResponse<>(homePageService.getlargeScreenRight(projectId));
    }
    @WebAccess(login = true)
    @GetMapping("getStatisticalAnalysis")
    @ApiOperation("云监管统计分析")
    public WebResponse<IndexStatisticalAnalysisVO> getStatisticalAnalysis(){
        return new WebResponse<>(homePageService.getStatisticalAnalysis());
    }
}
